import axios from "axios";
import {TIMEOUT} from "./config";

//利用axios对象的方法create，去创建一个axios实例
const removeWatermark = axios.create({
  //基础路径
  baseURL:"https://eeapi.cn",
  //请求超时时间   （5s内没响应就失败了）
  timeout:TIMEOUT
})

export default ({ url, method = 'GET', params = {}, data = {}, headers = {} }) => {
  return removeWatermark({
    url,
    method,
    params,
    data,
    headers
  })
}
